Getting Started with Sensors by Kimmo Karvinen & Tero Karvinen

Getting Started with Sensors by Kimmo Karvinen & Tero Karvinen

Author:Kimmo Karvinen & Tero Karvinen
Language: eng
Format: epub
Tags: COMPUTERS / Programming / Open Source
ISBN: 9781449367039
Publisher: Maker Media, Inc
Published: 2014-08-25T04:00:00+00:00


$ cat /sys/class/gpio/gpio3/value 1

Because you weren’t pressing the button, the internal pull-up resistor pulled GPIO 3 to 3.3 V, HIGH, so you got the value 1.

Next, hold down the button and read the value again (for a cool trick, you can recall the previous command by pressing the up arrow, so you don’t have to type it again):

$ cat /sys/class/gpio/gpio3/value 0

Well done! You can now read values from digital sensors. Even though you’ll soon practice with another digital sensor, the program will be very similar to this one.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.